import req from '@/utils/request';
import * as URL from '@/constants/api';

export function getCode (tel) {
  return req({
    url: URL.SEND_MSG + tel,
  })
  .then(res => res.data?.message);
}

export function login (tel, code) {
  return req({
    url: URL.LOGIN,
    method: 'POST',
    data: {
      mobile: tel,
      code,
    },
  }).then(res => res.data);
}
